from django.shortcuts import render
from django.http import HttpResponseBadRequest, HttpResponse, HttpRequest, JsonResponse
import hashlib
# from .models import Admin
from django.db.models import Q
# 提供查询sql语句的引入
from django.db.models.query import QuerySet
# 创建分页对象
from django.core.paginator import Paginator


# def admin_add(request):
# 	if request.POST.get("names"):
# 		username = request.POST.get("username")
# 	else:
# 		return JsonResponse({"state": 0, "msg": "缺少分类名称"})
#
# 	if request.POST.get("username"):
# 		username = request.POST.get("username")
# 	else:
# 		return JsonResponse({"state": 0, "msg": "缺少用户名"})
#
# 	if request.POST.get("name"):
# 		name = request.POST.get("name")
# 	else:
# 		return JsonResponse({"state": 0, "msg": "缺少用户名"})
#
# 	if request.POST.get("phone"):
# 		phone = request.POST.get("phone")
# 	else:
# 		return JsonResponse({"state": 0, "msg": "缺少电话"})